<template>
  <Dialog title="详细信息" v-model="dialogVisible" ref="checkRef">
    <el-descriptions column="1" border>
      <el-descriptions-item min-width="200" label="客户名称：">{{checkData.name}}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="手机号：">{{checkData.mobile}}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="意向等级：">{{checkData.level == 9 ? '重要客户' : checkData.level == 0 ? '无意向' : checkData.level == 1 ? '有意向' : checkData.level == 2 ? '高意向' : '' }}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="客户需求：">{{checkData.demand}}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="备注：">{{checkData.remark}}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="地址：">{{checkData.address}}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="客户IP地址：">{{checkData.ip}}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="浏览器标识：">{{checkData.userAgent}}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="终端类型：">{{checkData.clientType == 1 ? 'pc' : scope.row.clientType == 2  ? 'h5'  : 'app'}}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="来源网址：">{{checkData.sourceUrl}}</el-descriptions-item>
      <el-descriptions-item min-width="200" label="创建时间：">{{formatDate(checkData.createTime)}}</el-descriptions-item>
    </el-descriptions>
  </Dialog>
</template>
<script setup lang="ts">
import { Avatar, Headset } from '@element-plus/icons-vue'
import * as CustomerApi from '@/api/service/customer'
import { formatDate } from '@/utils/formatTime'

const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗

const dialogVisible = ref(false) // 弹窗的是否展示
const checkRef = ref() // 表单 Ref
const loading = ref(true) // 列表的加载中

const checkData = ref()

/** 打开弹窗 */
const open = async (row: object) => {
  dialogVisible.value = true
  checkData.value = row

}
defineExpose({ open }) // 提供 open 方法，用于打开弹窗

</script>
<style scoped lang="scss">

</style>
